#include "stm32f10x.h"

void InputCapture_Init(void)
{
    // enable tim3
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);
    // enable rcc-tim3
    // select internal clock input mode
    TIM_InternalClockConfig(TIM3);
    // configure time-base unit
    TIM_TimeBaseInitTypeDef TIM_TimeBaseInitParam;
    TIM_TimeBaseInitParam.TIM_ClockDivision = TIM_CKD_DIV1; // test git good
    TIM_TimeBaseInitParam.TIM_CounterMode = TIM_CounterMode_Up;
    TIM_TimeBaseInitParam.TIM_Period = 65536 - 1;
    TIM_TimeBaseInitParam.TIM_Prescaler = 72; // hz = 72 * 1000 * 1000 / 72 = 1000 * 1000hz
    TIM_TimeBaseInitParam.TIM_RepetitionCounter = 1;
    TIM_TimeBaseInit(TIM3, &TIM_TimeBaseInitParam);
    // init gpio for tix
    // init input capture
    // configure master/slave mode







}